chore(deps): update dependency nokogiri to v1.19.4 [security]#3402
chore(deps): update dependency nokogiri to v1.19.4 [security]#3402renovate-bot wants to merge 1 commit into
Conversation
|
/gcbrun |
There was a problem hiding this comment.
Code Review
This pull request updates the nokogiri gem from version 1.18.9 to 1.19.2 in the Gemfile.lock. A review comment highlights a discrepancy between the version implemented in the code and the version referenced in the pull request title and description, suggesting that the metadata be updated to ensure a clear audit trail.
| net-ssh (>= 4.0.0) | ||
| netrc (0.11.0) | ||
| nokogiri (1.18.9) | ||
| nokogiri (1.19.2) |
There was a problem hiding this comment.
There is a discrepancy between the version updated in the code (1.19.2) and the version mentioned in the pull request title and description (1.19.1). While 1.19.2 is a newer version that includes the required security fix, the PR metadata should be updated to accurately reflect the changes being merged to maintain a clear audit trail.
395c97f to
837bcbf
Compare
|
/gcbrun |
837bcbf to
3ee252c
Compare
|
/gcbrun |
3ee252c to
653fca1
Compare
|
/gcbrun |
653fca1 to
28d09fe
Compare
|
/gcbrun |
28d09fe to
d7fbf95
Compare
|
/gcbrun |
d7fbf95 to
d7491ae
Compare
|
/gcbrun |
d7491ae to
cc347f0
Compare
|
/gcbrun |
cc347f0 to
ee3f178
Compare
|
/gcbrun |
ee3f178 to
6149c89
Compare
|
/gcbrun |
6149c89 to
03e8917
Compare
|
/gcbrun |
03e8917 to
e8447e9
Compare
|
/gcbrun |
e8447e9 to
be5a6e8
Compare
|
/gcbrun |
be5a6e8 to
07de812
Compare
|
/gcbrun |
07de812 to
8edbac5
Compare
|
/gcbrun |
8edbac5 to
b53441f
Compare
|
/gcbrun |
b53441f to
8c82525
Compare
|
/gcbrun |
8c82525 to
33c267b
Compare
|
/gcbrun |
33c267b to
ff04699
Compare
|
/gcbrun |
ff04699 to
d35434e
Compare
|
/gcbrun |
d35434e to
9a2473a
Compare
|
/gcbrun |
9a2473a to
48f5d24
Compare
|
/gcbrun |
48f5d24 to
d4d579a
Compare
|
/gcbrun |
d4d579a to
922e10e
Compare
|
/gcbrun |
922e10e to
a4d8e03
Compare
|
/gcbrun |
a4d8e03 to
7995b2b
Compare
This PR contains the following updates:
1.18.9→1.19.4Nokogiri does not check the return value from xmlC14NExecute
GHSA-wx95-c6cv-8532
More information
Details
Summary
Nokogiri's CRuby extension fails to check the return value from
xmlC14NExecutein the methodNokogiri::XML::Document#canonicalizeandNokogiri::XML::Node#canonicalize. When canonicalization fails, an empty string is returned instead of raising an exception. This incorrect return value may allow downstream libraries to accept invalid or incomplete canonicalized XML, which has been demonstrated to enable signature validation bypass in SAML libraries.JRuby is not affected, as the Java implementation correctly raises
RuntimeErroron canonicalization failure.Mitigation
Upgrade to Nokogiri
>= 1.19.1.Severity
The maintainers have assessed this as Medium severity. Nokogiri itself is a parsing library without a clear security boundary related to canonicalization, so the direct impact is that a method returns incorrect data on invalid input. However, this behavior was exploited in practice to bypass SAML signature validation in downstream libraries (see References).
Credit
This vulnerability was responsibly reported by HackerOne researcher
d4d.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Nokogiri CSS selector tokenizer has regular expression backtracking
GHSA-c4rq-3m3g-8wgx
More information
Details
Summary
Nokogiri's CSS selector tokenizer contains regular expressions whose construction may result in exponential regex backtracking on adversarial selectors. Three ReDoS vectors are addressed in this release:
The public CSS selector methods that funnel through the affected tokenizer are
Nokogiri::CSS.xpath_for,Node#css,Node#at_css,Searchable#search, andCSS::Parser#parse.Mitigation
Upgrade to Nokogiri
>= 1.19.3.If users are unable to upgrade, two options are available:
Regexp.timeout(Ruby 3.2+, JRuby 9.4+) to bound parse time.Severity
The Nokogiri maintainers have evaluated this as High Severity (CVSS 7.5,
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).An attacker able to inject user-supplied text into a CSS selector parse method can cause exponential backtracking, resulting in a potential denial of service.
Resources
Credit
Vector 1 was responsibly reported by @colby-swandale. Vectors 2 and 3 were discovered by @flavorjones during the response to the original report.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Nokogiri XSLT transform has a memory leak
GHSA-v2fc-qm4h-8hqv
More information
Details
Summary
Nokogiri's
Nokogiri::XSLT::Stylesheet#transformleaks a small heap allocation when passed a Ruby string parameter containing a null byte.For applications that pass attacker-controlled input through
XSLT.transformparameters, this may be a vector for a denial of service attack against long-running processes.Mitigation
Upgrade to Nokogiri
>= 1.19.3.Users may also be able to mitigate this issue without upgrading by validating untrusted transform parameters before passing them to
Nokogiri::XSLT::Stylesheet#transform.Severity
The Nokogiri maintainers have evaluated this as Moderate Severity, CVSS 5.3.
Each leaked allocation is approximately 24–32 bytes, so meaningful memory growth requires sustained attacker-controlled traffic at high call rates. The bug does not cause memory corruption, information disclosure, or any change in the behavior of the transform itself, and the string-handling exception is raised as expected.
Applications that do not pass raw attacker-controlled bytes to XSLT parameters are unlikely to be affected in practice.
Resources
Credit
This vulnerability was responsibly reported by @Captainjack-kor.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Nokogiri: XML::Schema on JRuby allows network requests when NONET is set, bypassing CVE-2020-26247
GHSA-8678-w3jw-xfc2
More information
Details
Summary
The
NONETparse option, which Nokogiri turns on by default forNokogiri::XML::Schema(see CVE-2020-26247), was not correctly enforced on the JRuby implementation. As a result, a schema parsed with default options could still cause external resources to be fetched over the network, potentially enabling SSRF or XXE attacks.Nokogiri 1.19.4 replaces the scheme denylist with an allowlist. When
NONETis enabled, only local resources (afile:scheme, or a relative or absolute path with no scheme) are resolved, and every network scheme is blocked, case-insensitively. This brings the JRuby behavior in line with CRuby.Only the JRuby implementation is affected. CRuby is not affected, because libxml2's
xmlNoNetExternalEntityLoaderblocks all network schemes at the I/O layer regardless of scheme or case.Severity
The Nokogiri maintainers have evaluated this as low severity (CVSS 2.6,
CVSS:3.0/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N). It is a bypass of CVE-2020-26247, which was scored the same way.Mitigation
Upgrade to Nokogiri 1.19.4 or later.
There are no known workarounds for affected versions.
This change properly enforces
NONETon JRuby, which is a breaking change for any code that (perhaps unknowingly) relied on the previous behavior to load network resources with default parse options. If you trust your input and want to allow external resources to be accessed over the network, you can explicitly disableNONET, exactly as documented for CVE-2020-26247:Nokogiri::XML::ParseOptionswith theNONETflag turned off:References
Credit
This issue was responsibly reported by @bilerden.
Severity
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Nokogiri: Possible Out-of-Bounds Read in
Nokogiri::XML::NodeSet#[]GHSA-5prr-v3j2-97mh
More information
Details
Summary
Nokogiri::XML::NodeSet#[](and its alias#slice) checked the requested index against the node set's bounds using a 32-bit-truncated copy of the index. A large negative index could pass the check and then be used at full width, reading outside the node set's storage. On CRuby this is an out-of-bounds read that typically crashes the process; on JRuby it is not memory-unsafe but returns an incorrect node.Nokogiri 1.19.4 performs the bounds check against the full-width index.
Severity
The Nokogiri maintainers have evaluated this as medium severity.
Exploitation requires an application to pass an attacker-controlled integer to
NodeSet#[]. The primary impact is a controlled crash (denial of service), with potential for memory disclosure on CRuby.On JRuby, Nokogiri is not affected by this vulnerability.
Mitigation
Upgrade to Nokogiri 1.19.4 or later.
As a workaround, applications that index a
NodeSetwith externally-supplied integers can validate the index againstnode_set.lengthbefore use, or avoid passing untrusted values as an index.Credit
This issue was responsibly reported by Zheng Yu from depthfirst.com.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Nokogiri: Possible Use-After-Free when
Nokogiri::XML::Document#encoding=raises an exceptionGHSA-5v8h-3h3q-446p
More information
Details
Summary
Calling
Document#encoding=with an invalid encoding (e.g., a non-string, or a string containing a null byte) raises an exception, but only after freeing the document's current encoding string without replacing it. The document is left referencing freed memory, so the next call toDocument#encodingreads invalid memory, which can cause a segfault or leak freed bytes into a RubyString.Affects the CRuby (libxml2) implementation only; JRuby is not affected.
Severity
The Nokogiri maintainers have evaluated this as low severity. Reaching it requires an unusual API-usage pattern that does not arise during normal use. The application must pass an invalid encoding to
Document#encoding=, rescue the resulting exception, and then continue using the same document. Nokogiri 1.19.4 makes this pattern safe with no change to the public API. The document no longer references freed memory after the exception is raised.Mitigation
Upgrade to Nokogiri 1.19.4 or later.
If users are unable to upgrade, avoid passing attacker-controlled values to
Document#encoding=. Applications that only assign developer-authored encodings are not directly exposed.Credit
This issue was responsibly reported by Zheng Yu from depthfirst.com.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:UReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Nokogiri: Possible Use-After-Free when setting
Document#root=to an invalid node typeGHSA-wjv4-x9w8-wm3h
More information
Details
Summary
Nokogiri::XML::Document#root=validated only that the new root was aNokogiri::XML::Node, allowing a DTD node to be set as the document root. The result is a heap use-after-free during garbage collection or finalization, leading to an invalid memory read or potentially a segfault.Nokogiri 1.19.4 restricts
Document#root=to element nodes, raisingTypeErrorfor any other node type.This memory-safety issue affects only the CRuby implementation (libxml2). The JRuby implementation was not affected; the same input validation was added there for behavioral parity.
Severity
The Nokogiri maintainers have evaluated this as low severity. This is only triggered by a programming error. It requires application code to assign a non-element node such as a DTD as the document root via
Document#root=. Nokogiri 1.19.4 now raisesTypeErrorinstead of allowing a use-after-free. It cannot be triggered by untrusted input or through normal use of the public API.Mitigation
Upgrade to Nokogiri 1.19.4 or later.
As a workaround, applications that cannot upgrade should avoid assigning a DTD (or any non-element node) via
Document#root=.Credit
This issue was responsibly reported by Zheng Yu from depthfirst.com.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:UReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Nokogiri: Null Pointer Dereference calling methods on uninitialized wrapper classes
GHSA-9cv2-cfxc-v4v2
More information
Details
Summary
Nokogiri contains a bug when calling certain methods on allocated-but-uninitialized native wrapper classes that inherit from
Nokogiri::XML::Node. This caused a NULL pointer dereference that could crash the process.Nokogiri 1.19.4 checks for missing native data pointers and raises a
RuntimeError.JRuby is not affected.
Severity
The Nokogiri maintainers have evaluated this as low severity. This is only triggered by a programming error. It requires application code to call
.allocatedirectly on a native-backed class and then invoke methods on the resulting uninitialized object. It cannot be triggered by untrusted input or through normal use of the public API.Mitigation
Upgrade to Nokogiri 1.19.4 or later.
Avoid calling
.allocatedirectly on Nokogiri native-backed classes. Use the documented constructors and factory methods instead.Credit
This issue was responsibly reported by Zheng Yu from depthfirst.com.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:UReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Nokogiri: Possible Use-After-Free in XInclude Processing
GHSA-wfpw-mmfh-qq69
More information
Details
Summary
XInclude substitution performed by
Nokogiri::XML::Node#do_xincludereplaced each<xi:include>in place, freeing the include node along with its children (such as<xi:fallback>and its descendants) and any namespaces declared on them. If an application had already exposed one of those nodes or namespaces to Ruby, the corresponding Ruby object was left pointing at freed memory. Using the object could result in invalid reads or writes to memory.Nokogiri 1.19.4 substitutes each
<xi:include>on a defensive copy by default, so the structures libxml2 frees are never the ones bound to live Ruby objects.Only the CRuby implementation is affected; JRuby is not affected.
Severity
The Nokogiri maintainers have evaluated this as low severity. Reaching it requires an unusual API-usage pattern that does not arise during normal use. The application must parse a document without XInclude, traverse into an
<xi:include>subtree to expose its nodes or namespaces to Ruby, and only then invoke XInclude processing. The common case, requesting XInclude at parse time, operates on a freshly parsed document whose nodes are not yet exposed to Ruby and is not affected. Nokogiri 1.19.4 makes this pattern safe by default and requires no change to application code.Mitigation
Upgrade to Nokogiri 1.19.4 or later.
As a workaround for earlier versions, perform XInclude substitution at parse time (with the
xincludeparse option) rather than calling#do_xincludeon a document that has already been traversed. A freshly parsed document has no nodes exposed to Ruby, so the substitution is safe.Credit
This issue was responsibly reported by Zheng Yu from depthfirst.com.
Severity
Low
References
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Nokogiri: Possible Use-After-Free when setting an attribute value via
Nokogiri::XML::Attr#value=or#content=GHSA-phwj-rprq-35pp
More information
Details
Summary
Nokogiri’s CRuby native extension could leave a Ruby wrapper pointing to freed memory when replacing the value of an XML attribute. If Ruby code had already accessed an attribute child node,
Nokogiri::XML::Attr#value=could free the underlying native child node while the wrapper remained reachable through the document node cache. A later use of the freed child node or a Ruby GC mark could dereference an invalid pointer, causing an invalid read and a possible segfault.Nokogiri 1.19.4 preserves any already-wrapped attribute child nodes before replacing the attribute value.
JRuby is not affected.
Severity
The Nokogiri maintainers have evaluated this as low severity. Reaching it requires an unusual API-usage pattern that does not arise during normal use. The application must directly access an attribute's child node and then replace that same attribute's value via
Attr#value=or#content=. Nokogiri 1.19.4 makes this pattern safe with no change to the public API. Already-wrapped attribute child nodes are preserved before the value is replaced.Mitigation
Upgrade to Nokogiri 1.19.4 or later.
As a workaround, avoid accessing attribute child nodes directly via
Attr#childor similar before mutating the same attribute’s value.Credit
This issue was responsibly reported by Zheng Yu from depthfirst.com.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:UReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Nokogiri: Possible Use-After-Free when directly using
NokogirI::XML::XPathContextbeyond document lifetimeGHSA-p67v-3w7g-wjg7
More information
Details
Summary
Nokogiri::XML::XPathContextdid not keep its source document alive for garbage collection. If anXPathContextoutlived its document and the document was collected, evaluating an XPath expression could read invalid memory and potentially segfault.This is only reachable when application code constructs an
XPathContextdirectly and lets the document become unreachable while continuing to use the context. The normalDocument#xpath,#css, and related search methods are not affected, and it is not triggerable by malicious document input.Nokogiri 1.19.4 makes
XPathContextkeep its source document alive for as long as the context exists.Only the CRuby implementation is affected. JRuby is not affected.
Severity
The Nokogiri maintainers have evaluated this as low severity. Reaching it requires an unusual API-usage pattern that does not arise during normal use. The application must construct an
XML::XPathContextdirectly and continue using it after allowing its source document to be garbage-collected. Nokogiri 1.19.4 makes this pattern safe with no change to the public API. The context now keeps its source document alive for as long as it exists.Mitigation
Upgrade to Nokogiri 1.19.4 or later.
As a workaround, ensure the source document remains referenced for as long as any
XPathContextcreated from it is in use. The standardDocument#xpath,#css, and related search methods already do this and are unaffected.Credit
This issue was responsibly reported by Zheng Yu from depthfirst.com.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U/U:ClearReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.